<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>伪类选择器 | 你好,欢迎来到MyNote</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../lesson/css/扩展.html" />
    
    
    <link rel="prev" href="../../lesson/css/0724-4.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2.1.4"
        data-chapter-title="伪类选择器"
        data-filepath="lesson/css/0724-5.md"
        data-basepath="../.."
        data-revision="Thu Aug 31 2017 12:00:31 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="lesson/html/HTML.html">
            
                
                    <a href="../../lesson/html/HTML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        一.HTML
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="lesson/html/20170718.html">
            
                
                    <a href="../../lesson/html/20170718.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        第一节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="lesson/html/0718-3.html">
            
                
                    <a href="../../lesson/html/0718-3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.1.</b>
                        
                        a标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="lesson/html/0718-2.html">
            
                
                    <a href="../../lesson/html/0718-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.2.</b>
                        
                        注释标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="lesson/html/0718-1.html">
            
                
                    <a href="../../lesson/html/0718-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.3.</b>
                        
                        块级和行内元素
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="lesson/html/20170719.html">
            
                
                    <a href="../../lesson/html/20170719.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        第二节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="lesson/html/0719-3.html">
            
                
                    <a href="../../lesson/html/0719-3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.1.</b>
                        
                        实体字符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="lesson/html/0719-4.html">
            
                
                    <a href="../../lesson/html/0719-4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.2.</b>
                        
                        文本格式化
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="lesson/html/0719-1.html">
            
                
                    <a href="../../lesson/html/0719-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.3.</b>
                        
                        audio音频标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="lesson/html/0719-2.html">
            
                
                    <a href="../../lesson/html/0719-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.4.</b>
                        
                        video音频标签
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="lesson/html/20170720.html">
            
                
                    <a href="../../lesson/html/20170720.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        第三节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="lesson/html/input.html">
            
                
                    <a href="../../lesson/html/input.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.1.</b>
                        
                        课后补充
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="lesson/html/0720-1.html">
            
                
                    <a href="../../lesson/html/0720-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.2.</b>
                        
                        HTML表格
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="lesson/html/0720-2.html">
            
                
                    <a href="../../lesson/html/0720-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.3.</b>
                        
                        form表单
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="lesson/html/20170721.html">
            
                
                    <a href="../../lesson/html/20170721.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        第四节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="lesson/html/0721-5.html">
            
                
                    <a href="../../lesson/html/0721-5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.1.</b>
                        
                        icon
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="lesson/html/0721-2.html">
            
                
                    <a href="../../lesson/html/0721-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.2.</b>
                        
                        自定义列表
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="lesson/html/0721-3.html">
            
                
                    <a href="../../lesson/html/0721-3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.3.</b>
                        
                        iframe内嵌框架
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="lesson/html/0721-4.html">
            
                
                    <a href="../../lesson/html/0721-4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.4.</b>
                        
                        H5的语义化标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="lesson/html/0721-1.html">
            
                
                    <a href="../../lesson/html/0721-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.5.</b>
                        
                        图片的热区hotmap
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="lesson/css/CSS.html">
            
                
                    <a href="../../lesson/css/CSS.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        二.CSS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="lesson/css/20170724.html">
            
                
                    <a href="../../lesson/css/20170724.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        第一节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="lesson/css/0724-1.html">
            
                
                    <a href="../../lesson/css/0724-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.1.</b>
                        
                        元素选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="lesson/css/0724-3.html">
            
                
                    <a href="../../lesson/css/0724-3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.2.</b>
                        
                        ID选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="lesson/css/0724-4.html">
            
                
                    <a href="../../lesson/css/0724-4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.3.</b>
                        
                        关系选择器
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.1.4" data-path="lesson/css/0724-5.html">
            
                
                    <a href="../../lesson/css/0724-5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.4.</b>
                        
                        伪类选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.5" data-path="lesson/css/扩展.html">
            
                
                    <a href="../../lesson/css/扩展.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.5.</b>
                        
                        属性选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.6" data-path="lesson/css/扩展2.html">
            
                
                    <a href="../../lesson/css/扩展2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.6.</b>
                        
                        伪元素选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.7" data-path="lesson/css/0724-2.html">
            
                
                    <a href="../../lesson/css/0724-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.7.</b>
                        
                        class类选择器
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="lesson/css/20170725.html">
            
                
                    <a href="../../lesson/css/20170725.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        第二节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1" data-path="lesson/css/0725-1.html">
            
                
                    <a href="../../lesson/css/0725-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.1.</b>
                        
                        字体样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.2" data-path="lesson/css/0725-2.html">
            
                
                    <a href="../../lesson/css/0725-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.2.</b>
                        
                        文本描述
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.3" data-path="lesson/css/0725-3.html">
            
                
                    <a href="../../lesson/css/0725-3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.3.</b>
                        
                        文字阴影
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.4" data-path="lesson/css/0725-4.html">
            
                
                    <a href="../../lesson/css/0725-4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.4.</b>
                        
                        字体嵌入
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.5" data-path="lesson/css/0725-5.html">
            
                
                    <a href="../../lesson/css/0725-5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.5.</b>
                        
                        CSS颜色
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="lesson/css/20170726.html">
            
                
                    <a href="../../lesson/css/20170726.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        第三节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="lesson/css/0726-1.html">
            
                
                    <a href="../../lesson/css/0726-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.1.</b>
                        
                        border边框
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3.2" data-path="lesson/css/0726-2.html">
            
                
                    <a href="../../lesson/css/0726-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.2.</b>
                        
                        background背景
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="lesson/css/20170727.html">
            
                
                    <a href="../../lesson/css/20170727.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        第四节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="lesson/css/0727-2.html">
            
                
                    <a href="../../lesson/css/0727-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.1.</b>
                        
                        文字溢出
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4.2" data-path="lesson/css/0727-3.html">
            
                
                    <a href="../../lesson/css/0727-3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.2.</b>
                        
                        word-break
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4.3" data-path="lesson/css/0727-1.html">
            
                
                    <a href="../../lesson/css/0727-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.3.</b>
                        
                        文字对齐方式
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="lesson/css/20170728.html">
            
                
                    <a href="../../lesson/css/20170728.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        第五节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.5.1" data-path="lesson/css/0728-1.html">
            
                
                    <a href="../../lesson/css/0728-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.1.</b>
                        
                        定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5.2" data-path="lesson/css/0728-2.html">
            
                
                    <a href="../../lesson/css/0728-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.2.</b>
                        
                        z-index
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="lesson/css/20170731.html">
            
                
                    <a href="../../lesson/css/20170731.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        第六节课
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="lesson/css/20170801.html">
            
                
                    <a href="../../lesson/css/20170801.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        第七节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.7.1" data-path="lesson/css/0801-2.html">
            
                
                    <a href="../../lesson/css/0801-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.1.</b>
                        
                        git安装使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7.2" data-path="lesson/css/0801-1.html">
            
                
                    <a href="../../lesson/css/0801-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.2.</b>
                        
                        SASS安装使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="lesson/css/20170802.html">
            
                
                    <a href="../../lesson/css/20170802.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        第八节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.8.1" data-path="lesson/css/0802-1.html">
            
                
                    <a href="../../lesson/css/0802-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.1.</b>
                        
                        css3 过渡（transition）
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8.2" data-path="lesson/css/0802-2.html">
            
                
                    <a href="../../lesson/css/0802-2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.2.</b>
                        
                        css3 变换（transform）
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="lesson/css/20170803.html">
            
                
                    <a href="../../lesson/css/20170803.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        第九节课
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="lesson/css/20170804.html">
            
                
                    <a href="../../lesson/css/20170804.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        第十节课
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.10.1" data-path="lesson/css/0804-1.html">
            
                
                    <a href="../../lesson/css/0804-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.1.</b>
                        
                        滤镜
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="lesson/media/media.html">
            
                
                    <a href="../../lesson/media/media.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        三.项目期间
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="lesson/css/20170807.html">
            
                
                    <a href="../../lesson/css/20170807.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        鲁班项目(第一天)
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1" data-path="lesson/css/20170808.html">
            
                
                    <a href="../../lesson/css/20170808.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.1.</b>
                        
                        鲁班项目(第二天)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.1.2" data-path="lesson/css/20170809.html">
            
                
                    <a href="../../lesson/css/20170809.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.2.</b>
                        
                        鲁班项目(第三天)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.1.3" data-path="lesson/css/20170811.html">
            
                
                    <a href="../../lesson/css/20170811.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.3.</b>
                        
                        鲁班项目(第四天)
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="lesson/viewport/20170814.html">
            
                
                    <a href="../../lesson/viewport/20170814.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        viewport
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.2.1" data-path="lesson/viewport/20170814-1.html">
            
                
                    <a href="../../lesson/viewport/20170814-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.1.</b>
                        
                        viewport特性
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="lesson/viewport/20170815.html">
            
                
                    <a href="../../lesson/viewport/20170815.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        移动端项目
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.3.1" data-path="lesson/viewport/20170816.html">
            
                
                    <a href="../../lesson/viewport/20170816.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.1.</b>
                        
                        倒霉
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.3.1.1" data-path="lesson/viewport/0816-1.html">
            
                
                    <a href="../../lesson/viewport/0816-1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.1.1.</b>
                        
                        css长度单位
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.3.2" data-path="lesson/mobile-project/20170817project.html">
            
                
                    <a href="../../lesson/mobile-project/20170817project.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.2.</b>
                        
                        mobile项目入手
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3.3" data-path="lesson/mobile-project/20170818.html">
            
                
                    <a href="../../lesson/mobile-project/20170818.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.3.</b>
                        
                        记录
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3.4" data-path="lesson/viewport/20170821.html">
            
                
                    <a href="../../lesson/viewport/20170821.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.4.</b>
                        
                        项目中所遇的问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3.5" data-path="lesson/viewport/20170822.html">
            
                
                    <a href="../../lesson/viewport/20170822.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.5.</b>
                        
                        当日总结
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3.6" data-path="lesson/viewport/20170823.html">
            
                
                    <a href="../../lesson/viewport/20170823.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.6.</b>
                        
                        上交测试版
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3.7" data-path="lesson/viewport/20170824.html">
            
                
                    <a href="../../lesson/viewport/20170824.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.7.</b>
                        
                        当日总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="lesson/css/20170830.html">
            
                
                    <a href="../../lesson/css/20170830.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        接触框架
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="lesson/css/20170831.html">
            
                
                    <a href="../../lesson/css/20170831.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        语法与规则 Rules
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >你好,欢迎来到MyNote</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h2 id="&#x4F2A;&#x7C7B;&#x9009;&#x62E9;&#x5668;">&#x4F2A;&#x7C7B;&#x9009;&#x62E9;&#x5668;</h2>
<pre><code>&#x5B83;&#x53EF;&#x4EE5;&#x7406;&#x89E3;&#x4E3A;&#x662F;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x7684;&#x72B6;&#x6001;
</code></pre><h3 id="&#xFF1A;link">&#xFF1A;link</h3>
<pre><code>&#x8BED;&#x6CD5;&#xFF1A;a&#xFF1A;link {}
&#x8BF4;&#x660E;&#xFF1A;
&#x8BBE;&#x7F6E;&#x8D85;&#x94FE;&#x63A5;a&#x5728;&#x672A;&#x88AB;&#x8BBF;&#x95EE;&#x524D;&#x7684;&#x6837;&#x5F0F;&#x3002;
&#x5982;&#x679C;&#x9700;&#x8981;&#x7ED9;&#x8D85;&#x94FE;&#x63A5;&#x5B9A;&#x4E49;&#xFF1A;&#x8BBF;&#x95EE;&#x524D;&#xFF0C;&#x9F20;&#x6807;&#x60AC;&#x505C;&#xFF0C;&#x5F53;&#x524D;&#x88AB;&#x70B9;&#x51FB;&#xFF0C;&#x5DF2;&#x8BBF;&#x95EE;&#x8FD9;4&#x79CD;&#x4F2A;&#x7C7B;&#x6548;&#x679C;&#xFF0C;
&#x800C;&#x53C8;&#x6CA1;&#x6709;&#x6309;&#x7167;&#x4E00;&#x81F4;&#x7684;&#x4E66;&#x5199;&#x987A;&#x5E8F;&#xFF0C;&#x4E0D;&#x540C;&#x7684;&#x6D4F;&#x89C8;&#x5668;&#x53EF;&#x80FD;&#x4F1A;&#x6709;&#x4E0D;&#x540C;&#x7684;&#x8868;&#x73B0;
&#x8D85;&#x94FE;&#x63A5;&#x7684;4&#x79CD;&#x72B6;&#x6001;&#xFF0C;&#x9700;&#x8981;&#x6709;&#x7279;&#x5B9A;&#x7684;&#x4E66;&#x5199;&#x987A;&#x5E8F;&#x624D;&#x80FD;&#x751F;&#x6548;&#x3002;
</code></pre><blockquote>
<p>&#x8D85;&#x94FE;&#x63A5;&#x72B6;&#x6001;&#x987A;&#x5E8F;&#xFF1A;<br>    a:link {}<br>    a:visited {}<br>    a:hover {}<br>    a:active {}<br>    &#x6CE8;&#x610F;&#xFF0C;a:hover &#x5FC5;&#x987B;&#x4F4D;&#x4E8E; a:link &#x548C; a:visited &#x4E4B;&#x540E;&#xFF0C;a:active &#x5FC5;&#x987B;&#x4F4D;&#x4E8E; a:hover &#x4E4B;&#x540E;
    &#x53EF;&#x9760;&#x7684;&#x987A;&#x5E8F;&#x662F;&#xFF1A;l(link)ov(visited)e h(hover)a(active)te, &#x5373;&#x7528;&#x559C;&#x6B22;(love)&#x548C;&#x8BA8;&#x538C;(hate)&#x4E24;&#x4E2A;&#x8BCD;&#x6765;&#x6982;&#x62EC;   </p>
<pre><code class="lang-html"><span class="hljs-doctype">&lt;!DOCTYPE html&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">html</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">head</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">meta</span> <span class="hljs-attribute">charset</span>=<span class="hljs-value">&quot;UTF-8&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">style</span>&gt;</span><span class="css">
                <span class="hljs-rule"><span class="hljs-attribute">a</span>:<span class="hljs-value">link{
                <span class="hljs-comment">/*
                &#x6CA1;&#x88AB;&#x70B9;&#x8FC7;&#x7684;&#x65F6;&#x5019;
                 */</span>
                color: black</span></span>;
            }
            <span class="hljs-rule"><span class="hljs-attribute">a</span>:<span class="hljs-value">visited{
                <span class="hljs-comment">/*
                &#x5DF2;&#x7ECF;&#x88AB;&#x70B9;&#x8FC7;&#x4E86;
                 */</span>
                color: deepskyblue</span></span>;
            }
            <span class="hljs-rule"><span class="hljs-attribute">a</span>:<span class="hljs-value">hover{
                <span class="hljs-comment">/*
                &#x9F20;&#x6807;&#x8986;&#x76D6;&#x8EAB;&#x4E0A;&#x7684;&#x65F6;&#x5019;
                 */</span>
                color: red</span></span>;
            }
            <span class="hljs-rule"><span class="hljs-attribute">a</span>:<span class="hljs-value">active{
                <span class="hljs-comment">/*
                &#x9F20;&#x6807;&#x6FC0;&#x6D3B;&#x8BE5;&#x6807;&#x7B7E;&#x7684;&#x65F6;&#x5019;
                 */</span>
                color: yellowgreen</span></span>;
            }
        </span><span class="hljs-tag">&lt;/<span class="hljs-title">style</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">body</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">a</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">&quot;http://baidu.com&quot;</span>&gt;</span>&#x6211;&#x662F;&#x4E00;&#x4E2A;a<span class="hljs-tag">&lt;/<span class="hljs-title">a</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">html</span>&gt;</span>
</code></pre>
</blockquote>
<h3 id="focus&#x7126;&#x70B9;">:focus&#x7126;&#x70B9;</h3>
<pre><code class="lang-html"><span class="hljs-doctype">&lt;!DOCTYPE html&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-title">html</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">head</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">meta</span> <span class="hljs-attribute">charset</span>=<span class="hljs-value">&quot;UTF-8&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">style</span>&gt;</span><span class="css">
            <span class="hljs-class">.input</span><span class="hljs-rules">{<span class="hljs-comment">/*&#x83B7;&#x53D6;&#x7126;&#x70B9;&#x65F6;&#x7684;&#x72B6;&#x6001;*/</span>
                <span class="hljs-rule"><span class="hljs-attribute">color</span>:<span class="hljs-value"> red</span></span>;
            }</span>
            <span class="hljs-rule"><span class="hljs-attribute">.input</span>:<span class="hljs-value">focus{
                color: skyblue</span></span>;
            }
        </span><span class="hljs-tag">&lt;/<span class="hljs-title">style</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">body</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">input</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;text&quot;</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;input&quot;</span>/&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">html</span>&gt;</span>
</code></pre>
<h3 id="&#x5B50;&#x5143;&#x7D20;&#x7CFB;&#x5217;">&#x5B50;&#x5143;&#x7D20;&#x7CFB;&#x5217;</h3>
<blockquote>
<p>&#x5B50;&#x5143;&#x7D20;&#x7CFB;&#x5217;,&#x90FD;&#x662F;&#x901A;&#x8FC7;&#x5B50;&#x5143;&#x7D20;&#x7684;&#x4F4D;&#x7F6E;&#x6765;&#x63A7;&#x5236;&#x5BF9;&#x5E94;&#x7684;&#x5B50;&#x5143;&#x7D20;(&#x4E0D;&#x533A;&#x5206;&#x7C7B;&#x578B;)
```html
&lt;!DOCTYPE html&gt;</p>
<p><html>
    <head>
        <meta charset="UTF-8">
        <style></p>
</blockquote>
<pre><code>        ul&gt;li:nth-child(1){/*ul下面的第一个li子元素*/
            background: pink;
        }
        ul&gt;li:nth-child(odd){/*控制ul下面的奇数位置的li或者odd=2n+1*/
            background: pink;
        }
        ul&gt;li:nth-child(even){/*控制ul下面的偶数位置的li或者even=2n*/
            background: skyblue;
        }
        ul&gt;li:first-child,ul&gt;li:last-child{/*控制ul的第一个li和最后一个li子元素*/
            background: black;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;ul&gt;
        &lt;li&gt;1111&lt;/li&gt;
        &lt;li&gt;2222&lt;/li&gt;
        &lt;li&gt;3333&lt;/li&gt;
        &lt;li&gt;4444&lt;/li&gt;
    &lt;/ul&gt;
&lt;/body&gt;
</code></pre><p>&lt;/html&gt;</p>
<pre><code>
###子类型系列
&gt;与子元素系列对比，建议选择子类型系列
```html
&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta charset=&quot;UTF-8&quot;&gt;
        &lt;style&gt;
            ul&gt;li:first-of-type{/*控制ul下面的第一个li类型的子元素*/
                background: black;
            }
            ul&gt;div:nth-of-type(odd){/*控制ul下面的div类型元素,并且位置是在奇数位*/
                color: greenyellow;
            }
            ul&gt;div:nth-of-type(even){/*控制ul下面的div类型元素,并且位置是在偶数位*/
                color: greenyellow;
            }

            ul&gt;:nth-child(3n){/*控制ul下面的所有子元素,并且位置是3n的时候*/
                background: darkgrey;
            }
            ul&gt;:nth-of-type(3n){/*控制ul下面的所有子元素,并且位置是3n的时候*/
                background: yellow;
            }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;ul&gt;
            &lt;li&gt;1111&lt;/li&gt;
            &lt;li&gt;2222&lt;/li&gt;
            &lt;li&gt;3333&lt;/li&gt;
            &lt;li&gt;4444&lt;/li&gt;
            &lt;li&gt;5555&lt;/li&gt;
            &lt;li&gt;6666&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre><h3>：not</h3>
<pre><code class="lang-html">&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta charset=&quot;UTF-8&quot;&gt;
        &lt;style&gt;
            ul&gt;:not(li){/*控制非li的子元素*/
                font-size: 30px;
            }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;ul&gt;
            &lt;p&gt;11111&lt;/p&gt;
            &lt;div&gt;2222&lt;/div&gt;
            &lt;div&gt;2222&lt;/div&gt;
            &lt;div&gt;2222&lt;/div&gt;
            &lt;li&gt;1111&lt;/li&gt;
            &lt;li&gt;2222&lt;/li&gt;
            &lt;li&gt;3333&lt;/li&gt;
            &lt;li&gt;4444&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
<h3>:empty</h3>
<pre><code>语法：
E:empty { sRules }
说明：
匹配没有任何子元素（包括text节点）的元素E
</code></pre><pre><code class="lang-html">&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta charset=&quot;UTF-8&quot;&gt;
        &lt;style&gt;
            p:empty {
            height: 25px;
            border: 1px solid #ddd;
            background: #eee;
        }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div class=&quot;test&quot;&gt;
            &lt;p&gt;结构性伪类选择符 E:empty&lt;/p&gt;
            &lt;p&gt;&lt;!--我是一个空节点p，请注意我与其它非空节点p的外观有什么不一样--&gt;&lt;/p&gt;
            &lt;p&gt;结构性伪类选择符 E:empty&lt;/p&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
<h3>:checked</h3>
<pre><code>语法：
E:checked { sRules }
说明：
匹配用户界面上处于选中状态的元素E。(用于input type为radio与checkbox时)
兼容：IE9.0+，其他都支持
</code></pre><pre><code class="lang-html">&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta charset=&quot;UTF-8&quot;&gt;
        &lt;style&gt;
            input:checked + span {
            background: #f00;
        }
        input:checked + span:after {
            content: &quot; 我被选中了&quot;;
        }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;form method=&quot;post&quot; action=&quot;#&quot;&gt;
            &lt;fieldset&gt;
                &lt;legend&gt;选中下面的项试试&lt;/legend&gt;
                &lt;ul&gt;
                    &lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;colour-group&quot; value=&quot;0&quot; /&gt;&lt;span&gt;蓝色&lt;/span&gt;&lt;/label&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;colour-group&quot; value=&quot;1&quot; /&gt;&lt;span&gt;红色&lt;/span&gt;&lt;/label&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;colour-group&quot; value=&quot;2&quot; /&gt;&lt;span&gt;黑色&lt;/span&gt;&lt;/label&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/fieldset&gt;
            &lt;fieldset&gt;
                &lt;legend&gt;选中下面的项试试&lt;/legend&gt;
                &lt;ul&gt;
                    &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;colour-group2&quot; value=&quot;0&quot; /&gt;&lt;span&gt;蓝色&lt;/span&gt;&lt;/label&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;colour-group2&quot; value=&quot;1&quot; /&gt;&lt;span&gt;红色&lt;/span&gt;&lt;/label&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;colour-group2&quot; value=&quot;2&quot; /&gt;&lt;span&gt;黑色&lt;/span&gt;&lt;/label&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/fieldset&gt;
        &lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
</style></head></html></p></blockquote>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../lesson/css/0724-4.html" class="navigation navigation-prev " aria-label="Previous page: 关系选择器"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../lesson/css/扩展.html" class="navigation navigation-next " aria-label="Next page: 属性选择器"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"expandable-chapters-small":{},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
